package com.huiyeji.dynamic.core;

import com.huiyeji.dynamic.core.handler.PrefixHandler;
import com.huiyeji.dynamic.core.provider.ParamProvider;

import java.util.List;

/**
 * @author Huiyeji
 */
public class DynamicStatement {

    private final String originStatement;

    private final boolean requireExecute;

    private final String dynamicObjectName;

    private final String dynamicPrefix;

    private final String dynamicMethodName;

    private final String dynamicResultName;

    private final PrefixHandler prefixHandler;

    private final List<ParamProvider> paramProviders;

    public DynamicStatement(String originStatement, boolean requireExecute, String dynamicResultName, String dynamicPrefix, String dynamicObjectName, String dynamicMethodName, PrefixHandler prefixHandler, List<ParamProvider> paramProviders) {
        this.originStatement = originStatement;
        this.requireExecute = requireExecute;
        this.dynamicObjectName = dynamicObjectName;
        this.dynamicPrefix = dynamicPrefix;
        this.dynamicMethodName = dynamicMethodName;
        this.dynamicResultName = dynamicResultName;
        this.prefixHandler = prefixHandler;
        this.paramProviders = paramProviders;
    }

    public PrefixHandler getPrefixHandler() {
        return prefixHandler;
    }

    public boolean hasReturnValue(){
        return dynamicResultName != null && !"".equals(dynamicResultName);
    }

    public boolean isRequireExecute() {
        return requireExecute;
    }

    public String getDynamicObjectName() {
        return dynamicObjectName;
    }

    public String getDynamicPrefix() {
        return dynamicPrefix;
    }

    public String getDynamicMethodName() {
        return dynamicMethodName;
    }

    public String getDynamicResultName() {
        return dynamicResultName;
    }

    public List<ParamProvider> getParamProviders() {
        return paramProviders;
    }

    public String getOriginalStatement() {
        return originStatement;
    }

//    public void setRequireExecute(boolean requireExecute) {
//        this.requireExecute = requireExecute;
//    }
}
